package ui;
import java.awt.event.ActionEvent;
import java.sql.SQLException;
import java.util.Vector;

import javax.swing.AbstractAction;
import javax.swing.BorderFactory;
import javax.swing.DefaultComboBoxModel;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextPane;
import javax.swing.LayoutStyle;
import javax.swing.ListModel;

import javax.swing.WindowConstants;
import javax.swing.border.BevelBorder;
import javax.swing.SwingUtilities;
import dao.*;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class resultWindow extends javax.swing.JFrame {
	private BirdVO[] blist;
	private JPanel jPanel1;
	private JLabel jLabel3;
	private JLabel jLabel4;
	private JLabel jLabel5;
	private JScrollPane jScrollPane1;
	private JList resultList;
	private AbstractAction resultCloseAction;
	private JButton resultOkButton;
	private JLabel resultHabitatLabel;
	private JLabel resultFoodLabel;
	private JLabel resultRiskLabel;
	private JLabel resultSizeLabel;
	private JLabel resultWeidhtLabel;
	private JLabel labelColor;
	private JList popNameList;
	private JLabel labelURL;
	private JLabel labelClu;
	private JLabel labelLong;
	private JLabel labelIncu;
	private JLabel jLabel15;
	private JLabel jLabel7;
	private JLabel jLabel12;
	private JLabel jLabel13;
	private JLabel jLabel14;
	private AbstractAction getFetch;
	private AbstractAction fetchAction;
	private JButton fetch;
	private JLabel resultScientificNameLabel;
	private JLabel jLabel11;
	private JLabel jLabel10;
	private JLabel jLabel9;
	private JLabel jLabel8;
	private JLabel jLabel6;
	private JLabel jLabel2;
	private JLabel jLabel1;

	public resultWindow() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		
		try {
			GroupLayout thisLayout = new GroupLayout((JComponent)getContentPane());
			getContentPane().setLayout(thisLayout);
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			this.setTitle("Search Results");
			{
				jPanel1 = new JPanel();
				GroupLayout jPanel1Layout = new GroupLayout((JComponent)jPanel1);
				jPanel1.setLayout(jPanel1Layout);
				{
					jLabel1 = new JLabel();
					jLabel1.setText("General Information");
				}
				{
					jLabel2 = new JLabel();
					jLabel2.setText("Scientific Name:");
				}
				{
					jLabel3 = new JLabel();
					jLabel3.setText("Popular Name:");
				}
				{
					jLabel4 = new JLabel();
					jLabel4.setText("Weight:");
				}
				{
					jLabel5 = new JLabel();
					jLabel5.setText("Size:");
				}
				{
					jLabel6 = new JLabel();
					jLabel6.setText("Risk of Extintion:");
				}
				{
					jLabel8 = new JLabel();
					jLabel8.setText("Food Information");
				}
				{
					jLabel9 = new JLabel();
					jLabel9.setText("Feeds on:");
				}
				{
					jLabel10 = new JLabel();
					jLabel10.setText("Habitat Information");
				}
				{
					jLabel11 = new JLabel();
					jLabel11.setText("Habitat:");
				}
				{
					resultScientificNameLabel = new JLabel();
					resultScientificNameLabel.setText("none");
				}
				{
					resultWeidhtLabel = new JLabel();
					resultWeidhtLabel.setText("none");
				}
				{
					resultSizeLabel = new JLabel();
					resultSizeLabel.setText("none");
				}
				{
					resultRiskLabel = new JLabel();
					resultRiskLabel.setText("none");
				}
				{
					resultFoodLabel = new JLabel();
					resultFoodLabel.setText("none");
				}
				{
					resultHabitatLabel = new JLabel();
					resultHabitatLabel.setText("none");
				}
				{
					resultOkButton = new JButton();
					resultOkButton.setText("OK");
					resultOkButton.setAction(getResultCloseAction());
				}
				jPanel1Layout.setHorizontalGroup(jPanel1Layout.createSequentialGroup()
					.addContainerGap()
					.addGroup(jPanel1Layout.createParallelGroup()
					    .addComponent(getJScrollPane1(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 130, GroupLayout.PREFERRED_SIZE)
					    .addComponent(getFetch(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 130, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
					.addGroup(jPanel1Layout.createParallelGroup()
					    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					        .addComponent(jLabel10, GroupLayout.PREFERRED_SIZE, 149, GroupLayout.PREFERRED_SIZE)
					        .addGap(16))
					    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					        .addComponent(jLabel1, GroupLayout.PREFERRED_SIZE, 149, GroupLayout.PREFERRED_SIZE)
					        .addGap(16))
					    .addComponent(jLabel8, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 165, GroupLayout.PREFERRED_SIZE)
					    .addGroup(jPanel1Layout.createSequentialGroup()
					        .addGap(20)
					        .addGroup(jPanel1Layout.createParallelGroup()
					            .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					                .addComponent(jLabel11, GroupLayout.PREFERRED_SIZE, 116, GroupLayout.PREFERRED_SIZE)
					                .addGap(12))
					            .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					                .addComponent(getJLabel14(), GroupLayout.PREFERRED_SIZE, 123, GroupLayout.PREFERRED_SIZE)
					                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED))
					            .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					                .addComponent(getJLabel13(), GroupLayout.PREFERRED_SIZE, 116, GroupLayout.PREFERRED_SIZE)
					                .addGap(12))
					            .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					                .addComponent(getJLabel12(), GroupLayout.PREFERRED_SIZE, 90, GroupLayout.PREFERRED_SIZE)
					                .addGap(38))
					            .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					                .addComponent(getJLabel7(), GroupLayout.PREFERRED_SIZE, 104, GroupLayout.PREFERRED_SIZE)
					                .addGap(24))
					            .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					                .addComponent(getJLabel15(), GroupLayout.PREFERRED_SIZE, 116, GroupLayout.PREFERRED_SIZE)
					                .addGap(12))
					            .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					                .addComponent(jLabel6, GroupLayout.PREFERRED_SIZE, 116, GroupLayout.PREFERRED_SIZE)
					                .addGap(12))
					            .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					                .addComponent(jLabel5, GroupLayout.PREFERRED_SIZE, 116, GroupLayout.PREFERRED_SIZE)
					                .addGap(12))
					            .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					                .addComponent(jLabel4, GroupLayout.PREFERRED_SIZE, 116, GroupLayout.PREFERRED_SIZE)
					                .addGap(12))
					            .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					                .addComponent(jLabel2, GroupLayout.PREFERRED_SIZE, 116, GroupLayout.PREFERRED_SIZE)
					                .addGap(12))
					            .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					                .addComponent(jLabel3, GroupLayout.PREFERRED_SIZE, 116, GroupLayout.PREFERRED_SIZE)
					                .addGap(12))
					            .addComponent(jLabel9, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 128, GroupLayout.PREFERRED_SIZE))
					        .addGap(17)))
					.addGroup(jPanel1Layout.createParallelGroup()
					    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					        .addComponent(getPopNameList(), 0, 152, Short.MAX_VALUE)
					        .addGap(25))
					    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					        .addComponent(resultScientificNameLabel, GroupLayout.PREFERRED_SIZE, 165, GroupLayout.PREFERRED_SIZE)
					        .addGap(0, 12, Short.MAX_VALUE))
					    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					        .addComponent(resultWeidhtLabel, GroupLayout.PREFERRED_SIZE, 165, GroupLayout.PREFERRED_SIZE)
					        .addGap(0, 12, Short.MAX_VALUE))
					    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					        .addComponent(resultSizeLabel, GroupLayout.PREFERRED_SIZE, 165, GroupLayout.PREFERRED_SIZE)
					        .addGap(0, 12, Short.MAX_VALUE))
					    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					        .addComponent(resultRiskLabel, GroupLayout.PREFERRED_SIZE, 165, GroupLayout.PREFERRED_SIZE)
					        .addGap(0, 12, Short.MAX_VALUE))
					    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					        .addComponent(getLabelIncu(), GroupLayout.PREFERRED_SIZE, 165, GroupLayout.PREFERRED_SIZE)
					        .addGap(0, 12, Short.MAX_VALUE))
					    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					        .addComponent(getLabelLong(), GroupLayout.PREFERRED_SIZE, 165, GroupLayout.PREFERRED_SIZE)
					        .addGap(0, 12, Short.MAX_VALUE))
					    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					        .addComponent(getLabelClu(), GroupLayout.PREFERRED_SIZE, 165, GroupLayout.PREFERRED_SIZE)
					        .addGap(0, 12, Short.MAX_VALUE))
					    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					        .addComponent(getLabelURL(), GroupLayout.PREFERRED_SIZE, 165, GroupLayout.PREFERRED_SIZE)
					        .addGap(0, 12, Short.MAX_VALUE))
					    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					        .addComponent(getLabelColor(), GroupLayout.PREFERRED_SIZE, 165, GroupLayout.PREFERRED_SIZE)
					        .addGap(0, 12, Short.MAX_VALUE))
					    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					        .addComponent(resultFoodLabel, GroupLayout.PREFERRED_SIZE, 165, GroupLayout.PREFERRED_SIZE)
					        .addGap(0, 12, Short.MAX_VALUE))
					    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					        .addComponent(resultHabitatLabel, GroupLayout.PREFERRED_SIZE, 165, GroupLayout.PREFERRED_SIZE)
					        .addGap(0, 12, Short.MAX_VALUE))
					    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					        .addGap(0, 91, Short.MAX_VALUE)
					        .addComponent(resultOkButton, GroupLayout.PREFERRED_SIZE, 86, GroupLayout.PREFERRED_SIZE))));
				jPanel1Layout.setVerticalGroup(jPanel1Layout.createSequentialGroup()
					.addGroup(jPanel1Layout.createParallelGroup()
					    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					        .addComponent(jLabel1, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
					        .addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
					            .addComponent(resultScientificNameLabel, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					            .addComponent(jLabel2, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
					        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
					        .addGroup(jPanel1Layout.createParallelGroup()
					            .addComponent(getPopNameList(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
					            .addComponent(jLabel3, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
					        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
					        .addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
					            .addComponent(resultWeidhtLabel, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					            .addComponent(jLabel4, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
					        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
					        .addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
					            .addComponent(resultSizeLabel, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					            .addComponent(jLabel5, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
					        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
					        .addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
					            .addComponent(resultRiskLabel, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					            .addComponent(jLabel6, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
					        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
					        .addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
					            .addComponent(getLabelIncu(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					            .addComponent(getJLabel15(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
					        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
					        .addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
					            .addComponent(getLabelLong(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					            .addComponent(getJLabel7(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
					        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
					        .addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
					            .addComponent(getLabelClu(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					            .addComponent(getJLabel12(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
					        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
					        .addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
					            .addComponent(getLabelURL(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					            .addComponent(getJLabel13(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
					        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
					        .addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
					            .addComponent(getLabelColor(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					            .addComponent(getJLabel14(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
					        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
					        .addComponent(jLabel8, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
					        .addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
					            .addComponent(resultFoodLabel, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					            .addComponent(jLabel9, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
					        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
					        .addComponent(jLabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
					        .addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
					            .addComponent(resultHabitatLabel, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					            .addComponent(jLabel11, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)))
					    .addGroup(GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
					        .addGap(12)
					        .addComponent(getJScrollPane1(), GroupLayout.PREFERRED_SIZE, 276, GroupLayout.PREFERRED_SIZE)
					        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
					        .addComponent(getFetch(), GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					        .addGap(8)))
					.addGap(0, 21, Short.MAX_VALUE)
					.addComponent(resultOkButton, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					.addContainerGap());
			}
			thisLayout.setVerticalGroup(thisLayout.createSequentialGroup()
				.addComponent(jPanel1, 0, 414, Short.MAX_VALUE));
			thisLayout.setHorizontalGroup(thisLayout.createSequentialGroup()
				.addGap(6)
				.addComponent(jPanel1, 0, 528, Short.MAX_VALUE));
			pack();
			this.setSize(507, 418);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	
	private AbstractAction getResultCloseAction() {
		if(resultCloseAction == null) {
			resultCloseAction = new AbstractAction("Close", null) {
				public void actionPerformed(ActionEvent evt) {
					setVisible(false);
			        dispose();
				}
			};
		}
		return resultCloseAction;
	}
	
	private JList getResultList() {
		Vector<String> birdNames = new Vector<String>();
		
		if(resultList == null) {
			ListModel resultListModel = 
				new DefaultComboBoxModel(
					birdNames.toArray());
			resultList = new JList();
			resultList.setModel(resultListModel);
		}
		return resultList;
	}
	

	
	private JScrollPane getJScrollPane1() {
		if(jScrollPane1 == null) {
			jScrollPane1 = new JScrollPane();
			jScrollPane1.setViewportView(getResultList());
		}
		return jScrollPane1;
	}
	
	private JButton getFetch() {
		if(fetch == null) {
			fetch = new JButton();
			fetch.setText("Display");
			fetch.setAction(getGetFetch());
		}
		return fetch;
	}
	
	//Locally stores the birds which the search engine found.
	public void insertData(BirdVO[] data) {
		Vector<String> birdNames = new Vector<String>();
		ListModel lM;
		blist = data;
		
		birdNames.add("None");
		if (blist!= null && blist.length > 0) {
			for (int i = 0; i < blist.length; i++ ) {
				birdNames.add(blist[i].getScientific_name());
			}
		}
		
		lM = new DefaultComboBoxModel(birdNames.toArray());
		
		resultList.setModel(lM);
	}
	
	private AbstractAction getGetFetch() {
		if(getFetch == null) {
			getFetch = new AbstractAction("Fetch", null) {
				public void actionPerformed(ActionEvent evt) {
					int index = resultList.getSelectedIndex();
					String food,popName, roe, sciName, size,
					weight, habitat, incub, longevity, clutch, color,
					imgurl;
					
					if ( index > 0 && blist.length > 0 ) {
						/* GetInfo */
						food = blist[index-1].getDiet();
						//popName = BirdDAO.listPopularNames(blist[index-1]);
						roe = String.valueOf(blist[index-1].getRisk_of_extinction());
						sciName = blist[index-1].getScientific_name();
						size = String.valueOf(blist[index-1].getSize());
						weight = String.valueOf(blist[index-1].getWeight());
						habitat = blist[index-1].getHabitat();
						incub = String.valueOf(blist[index-1].getIncubationtime());
						longevity = String.valueOf(blist[index-1].getLongevity());
						clutch = String.valueOf(blist[index-1].getClutchsize());
						color = blist[index-1].getColor();
						imgurl = blist[index-1].getImageurl();

						/* Print stuff */
						resultScientificNameLabel.setText(sciName);
						Vector<String> dum = new Vector<String>();
						
						try {
							for(PopularNamesVO ovo: BirdDAO.listPopularNames(blist[index-1]))
								dum.add(ovo.getName());
						} catch (SQLException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}
						
						addPopularNamesToList(dum);
	
						resultWeidhtLabel.setText(weight);
						resultRiskLabel.setText(roe);
						resultFoodLabel.setText(food);
						resultHabitatLabel.setText(habitat);
						resultSizeLabel.setText(size);
						labelIncu.setText(incub);
						labelLong.setText(longevity);
						labelClu.setText(clutch);
						labelColor.setText(color);
						labelURL.setText(imgurl);
					} else {
						resultScientificNameLabel.setText("none");
						resultWeidhtLabel.setText("none");
						resultRiskLabel.setText("none");
						resultFoodLabel.setText("none");
						resultHabitatLabel.setText("none");
						resultSizeLabel.setText("none");
						labelIncu.setText("none");
						labelLong.setText("none");
						labelClu.setText("none");
						labelColor.setText("none");
						labelURL.setText("none");
					}
				}
			};
		}
		return getFetch;
	}
	
	private JLabel getJLabel14() {
		if(jLabel14 == null) {
			jLabel14 = new JLabel();
			jLabel14.setText("Color:");
		}
		return jLabel14;
	}
	
	private JLabel getJLabel13() {
		if(jLabel13 == null) {
			jLabel13 = new JLabel();
			jLabel13.setText("Image URL:");
		}
		return jLabel13;
	}
	
	private JLabel getJLabel12() {
		if(jLabel12 == null) {
			jLabel12 = new JLabel();
			jLabel12.setText("Clutch Size:");
		}
		return jLabel12;
	}
	
	private JLabel getJLabel7() {
		if(jLabel7 == null) {
			jLabel7 = new JLabel();
			jLabel7.setText("Longevity:");
		}
		return jLabel7;
	}
	
	private JLabel getJLabel15() {
		if(jLabel15 == null) {
			jLabel15 = new JLabel();
			jLabel15.setText("Incubation Time:");
		}
		return jLabel15;
	}
	
	private JLabel getLabelIncu() {
		if(labelIncu == null) {
			labelIncu = new JLabel();
			labelIncu.setText("none");
		}
		return labelIncu;
	}
	
	private JLabel getLabelLong() {
		if(labelLong == null) {
			labelLong = new JLabel();
			labelLong.setText("none");
		}
		return labelLong;
	}
	
	private JLabel getLabelClu() {
		if(labelClu == null) {
			labelClu = new JLabel();
			labelClu.setText("none");
		}
		return labelClu;
	}
	
	private JLabel getLabelURL() {
		if(labelURL == null) {
			labelURL = new JLabel();
			labelURL.setText("none");
		}
		return labelURL;
	}
	
	private JLabel getLabelColor() {
		if(labelColor == null) {
			labelColor = new JLabel();
			labelColor.setText("none");
		}
		return labelColor;
	}
	
	private JList getPopNameList() {
		if(popNameList == null) {
			ListModel popNameListModel = 
				new DefaultComboBoxModel(
						new String[] { "" });
			popNameList = new JList();
			popNameList.setModel(popNameListModel);
		}
		return popNameList;
	}
	
	private void addPopularNamesToList(Vector<String> names) {
		ListModel popNameListModel = new DefaultComboBoxModel(names);
		popNameList.setModel(popNameListModel);
	}

}
